<div id="pie" style="width: 500px;height:400px;margin: 0 auto"></div>
<script>
    var pie = echarts.init(document.getElementById('pie'));
    pie.setOption({
        title : {
            text: '角色分配',
            subtext: '比列',
            x:'center'
        },
    });
    $.ajax({
        type:'get',
        url:'pie',
        cache: false,
        success:function(data){
            pie.setOption({
                tooltip : {
                    trigger: 'item',
                    formatter: "{b} <br/>{a} : {c} ({d}%)"
                },
                legend: {
                    orient: 'vertical',
                    left: 'left',
                    data: data.names
                },
                series : [
                    {
                        name: '用户比例',
                        type: 'pie',
                        radius : '55%',
                        center: ['50%', '60%'],
                        data:data.combined,
                        itemStyle: {
                            emphasis: {
                                shadowBlur: 10,
                                shadowOffsetX: 0,
                                shadowColor: 'rgba(0, 0, 0, 0.5)'
                            }
                        }
                    }
                ]
            });
        },
        error:function(data){
            return false
        }
    });
</script>